﻿''' <summary>Generic Note schema</summary>
Public Class Note
    Inherits Indexable



    Public Sub New(ByVal content As String, ByVal format As IndexFormats, ByVal uri As String, ByVal last_modified_time As Date)
        MyBase.New(content, format)
        Me._uri = uri
        Me._last_modified_time = last_modified_time
    End Sub


    ''' <summary>Unique identifier </summary>
    ''' <remarks> required  </remarks>
    <MarshalAs(UnmanagedType.BStr)> _
    Private _uri As String
    ''' <summary>Time last modified </summary>
    ''' <remarks> required  </remarks>
    Private _last_modified_time As Date



    ''' <summary>Title </summary>
    <MarshalAs(UnmanagedType.BStr)> _
    Private _title As String
    ''' <summary>Folder name </summary>
    <MarshalAs(UnmanagedType.BStr)> _
    Private _folder_name As String
    ''' <summary>Note categories </summary>
    <MarshalAs(UnmanagedType.BStr)> _
    Private _categories As String
    ''' <summary>Note date </summary>
    Private _date As Date



    ''' <summary>Note date </summary>
    Public Property [Date]() As Date
        Get
            Return _date
        End Get
        Set(ByVal value As Date)
            _date = value
        End Set
    End Property
    ''' <summary>Note categories </summary>
    Public Property Categories() As String
        Get
            Return _categories
        End Get
        Set(ByVal value As String)
            _categories = value
            SetOtherPropertiesFlag()
        End Set
    End Property
    ''' <summary>Folder name </summary>
    Public Property Folder_name() As String
        Get
            Return _folder_name
        End Get
        Set(ByVal value As String)
            _folder_name = value
            SetOtherPropertiesFlag()
        End Set
    End Property
    ''' <summary>Time last modified </summary>
    ''' <remarks> required  </remarks>
    Public ReadOnly Property Last_modified_time() As Date
        Get
            Return _last_modified_time
        End Get
    End Property
    ''' <summary>Title </summary>
    Public Property Title() As String
        Get
            Return _title
        End Get
        Set(ByVal value As String)
            _title = value
            SetOtherPropertiesFlag()
        End Set
    End Property
    ''' <summary>Unique identifier </summary>
    ''' <remarks> required  </remarks>
    Public ReadOnly Property Uri() As String
        Get
            Return _uri
        End Get
    End Property

    Protected Overrides Sub AddRequredProperties(ByVal e As [Event])
        MyBase.AddRequredProperties(e)


        e.AddProperty("uri", Me._uri)
        e.AddProperty("last_modified_time", Me._last_modified_time.ToOADate)
    End Sub

    Protected Overrides Sub AddOtherProperties(ByVal e As [Event])
        MyBase.AddOtherProperties(e)


        If Not String.IsNullOrEmpty(_title) Then e.AddProperty("title", _title)
        If Not String.IsNullOrEmpty(_folder_name) Then e.AddProperty("folder_name", _folder_name)
        If Not String.IsNullOrEmpty(_categories) Then e.AddProperty("categories", _categories)


        e.AddProperty("date", Me._date.ToOADate)



    End Sub




End Class

